#ifndef RENDERCOMMAND_H
#define RENDERCOMMAND_H

#include "Renderer/rendererAPI.h"

namespace CC
{

	class CC_EXPORT RenderCommand
	{
	public:
		static void Init()
		{
			s_RendererAPI->Init();
		}

		static void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
		{
			s_RendererAPI->SetViewport(x, y, width, height);
		}

		static void SetClearColor(const glm::vec4 &color)
		{
			s_RendererAPI->SetClearColor(color);
		}

		static void Clear()
		{
			s_RendererAPI->Clear();
		}

		static void ClearDepth()
		{
			s_RendererAPI->ClearDepth();
		}

		static void Clear(CapEnum bit)
		{
			s_RendererAPI->Clear(bit);
		}

		static void DrawIndexed(const VertexArray *vertexArray, uint32_t indexCount = 0, DisplayModesEnum mode = DisplayModesEnum::DisplayModesEnum_TRIANGLES)
		{
			s_RendererAPI->DrawIndexed(vertexArray, indexCount, mode);
		}

        static void DrawArrays(const VertexArray *vertexArray, uint32_t count = 0, DisplayModesEnum mode = DisplayModesEnum::DisplayModesEnum_TRIANGLES)
        {
            s_RendererAPI->DrawArrays(vertexArray, count, mode);
        }

		static void DrawLines(const VertexArray *vertexArray, uint32_t vertexCount)
		{
			s_RendererAPI->DrawLines(vertexArray, vertexCount);
		}

		static void SetLineWidth(float width)
		{
			s_RendererAPI->SetLineWidth(width);
		}

		static void UnBindTexture()
		{
			s_RendererAPI->UnBindTexture();
		}

		static void BindTexture(uint32_t slot, uint32_t ID)
		{
			s_RendererAPI->BindTexture(slot, ID);
		}

		static void CullFace(CullFaceEnum type)
		{
			s_RendererAPI->CullFace(type);
		}

		static void SetEnableState(CapEnum cap, bool enable)
		{
			s_RendererAPI->SetEnableState(cap, enable);
		}

        static void SetDepthFunc(DepthFuncEnum func)
        {
            s_RendererAPI->SetDepthFunc(func);
        }

	private:
		static RendererAPI *s_RendererAPI;
	};

}

#endif